<template>
  <div class="dashboard">
    <h1>健康仪表盘</h1>
    <p class="subtitle">今日健康数据概览</p>
    
    <!-- 简化版卡片 -->
    <div class="simple-cards">
      <div class="card">
        <h3>运动</h3>
        <p>{{ store.todayExercise }} 分钟</p>
      </div>
      <div class="card">
        <h3>饮食</h3>
        <p>{{ store.todayCalories }} 大卡</p>
      </div>
      <div class="card">
        <h3>睡眠</h3>
        <p>{{ store.todaySleep }} 小时</p>
      </div>
    </div>
    
    <div class="progress-section">
      <h2>目标进度</h2>
      <div class="simple-progress">
        <div class="progress-item">
          <h4>运动目标</h4>
          <p>{{ store.exerciseProgress.toFixed(1) }}%</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { useHealthStore } from '@/stores/healthStore'

const store = useHealthStore()
</script>

<style scoped>
.dashboard {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

h1 {
  color: #2c3e50;
  margin-bottom: 5px;
}

.subtitle {
  color: #7f8c8d;
  margin-top: 0;
  margin-bottom: 20px;
}

.simple-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-align: center;
}

.card h3 {
  margin-top: 0;
  color: #3498db;
}

.card p {
  font-size: 24px;
  font-weight: bold;
  margin: 10px 0;
}

.progress-section {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.simple-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.progress-item {
  background: #f8f9fa;
  padding: 15px 25px;
  border-radius: 10px;
  min-width: 200px;
}

.progress-item h4 {
  margin: 0 0 5px;
  color: #555;
}

.progress-item p {
  font-size: 24px;
  font-weight: bold;
  margin: 0;
  color: #2c3e50;
}
</style>